package org.example;

import org.entity.MainConfiguration;
import org.entity.Student;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Main2 {
    public static void main(String[] args) {
        // 通过注解的方式创建容器
        ApplicationContext context = new AnnotationConfigApplicationContext(MainConfiguration.class);
        // 通过容器获取对象
        Student student = (Student) context.getBean("student");
        System.out.println(student);
    }
}
